package com.example.pattern.strategy;

import com.example.pattern.strategy.impl.FlagZombie;
import com.example.pattern.strategy.impl.NormalZombie;

/**
 * 策略设计模式
 *  定义了算法族，让它们之间互相替换，此模式的变化独立于算法的使用者
 */
public class StrategyTest {

    public static void main(String[] args) {

        Zombie zombie = new NormalZombie();
        zombie.display();
        zombie.move();
        zombie.attack();
        System.out.println("-------------");
        zombie = new FlagZombie();
        zombie.display();
        zombie.move();
        zombie.attack();

    }

}
